package definition.comparable;
/**
 * 该类重写了hashCode和equals方法，使其对象相等且具有相同的哈希值
 * 同时重写了compareTo方法，使其对象始终大于另一对象，导致自然排序不一致
 * @author fidel
 */
public class SubClass extends OneselfClass {
    @Override
    public int compareTo(SuperClass o) {
        return -1;
    }

    @Override
    public int hashCode() {
        return 1;
    }

    @Override
    public boolean equals(Object obj) {
        return true;
    }
}
